ILLDEV-277 Add patron request events endpoint#399
Merged
JanisSaldabols merged 2 commits intomainfrom Feb 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a new endpoint to retrieve events associated with a specific patron request. The implementation follows established patterns in the codebase and includes comprehensive test coverage.
Changes:
- Added
/patron_requests/{id}/eventsGET endpoint to retrieve patron request related events - Implemented repository method
GetPatronRequestEventsto query events by patron request ID - Added
patronRequestIDfield to Event schema in OpenAPI specification - Updated all handler instantiations to include the event repository dependency
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| broker/oapi/open-api.yaml | Added /patron_requests/{id}/events endpoint specification and patronRequestID field to Event schema |
| broker/sqlc/event_query.sql | Added SQL query GetPatronRequestEvents to fetch events by patron request ID ordered by timestamp |
| broker/events/eventrepo.go | Implemented GetPatronRequestEvents method in interface and repository following existing patterns |
| broker/patron_request/api/api-handler.go | Added GetPatronRequestsIdEvents handler and toApiEvent conversion function; updated constructor to accept event repository |
| broker/app/app.go | Updated API handler initialization to pass event repository |
| broker/test/mocks/mock_eventrepo.go | Added mock implementations of GetPatronRequestEvents for success and error scenarios |
| broker/patron_request/api/api-handler_test.go | Added comprehensive unit tests covering missing symbol, DB errors, side validation, and event retrieval errors |
| broker/test/patron_request/api/api-handler_test.go | Added integration test assertions to verify events are returned in the complete workflow test |
adamdickmeiss
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.